{extend name='common@layout/buy' /}
{block name='content'}
<div class="ncc-wrapper">
    <div class="ncc-main" style="min-height: 600px;">
        <div class="ncc-title">
            <h3>支付提交</h3>
            <h5>订单详情内容可通过查看<a href="<?php echo url('member/order/index');?>" target="_blank">我的订单</a>进行核对处理。</h5>
        </div>
        <?php if ($order_list[0]['payment_code'] == 'offline') {?>
        <form action="{:url('member/payment/offline')}" method="POST" enctype="multipart/form-data" id="buy_form">
            <?php }else{?>
            <form action="{:url('member/payment/real_order')}" method="POST" id="buy_form">
                <?php }?>	
                <input type="hidden" name="pay_sn" value="<?php echo $pay_info['pay_sn'];?>">
                <input type="hidden" id="payment_code" name="payment_code" value="">
                <div class="ncc-receipt-info">
                    <div class="ncc-receipt-info-title">
                        <h3><?php echo $order_remind;?>
                            <?php if ($pay_amount_online > 0) {?>
                            在线支付金额：<strong>￥<?php echo $pay_amount_online;?></strong>
                            <?php } ?>
                        </h3>
                    </div>
                    <table class="ncc-table-style">
                        <thead>
                            <tr class="fb f14">
                                <th class="w50"></th>
                                <th class="w200 tl">订单号</th>
                                <th class="tl w150">支付方式</th>
                                <th class="tl">金额</th>
                                <th class="w150">物流</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php if (count($order_list)>1) {?>
                            <tr>
                                <th colspan="20">由于您的商品由不同商家发出，此单将分为<?php echo count($order_list);?>个不同子订单配送！</th>
                            </tr>
                            <?php }?>
                            <?php foreach ($order_list as $key => $order) {?>
                            <tr>
                                <td></td>
                                <td class="tl"><?php echo $order['order_sn']; ?></td>
                                <td class="tl"><?php echo $order['payment_state'];?></td>
                                <td class="tl">￥<?php echo $order['order_amount'];?></td>
                                <td>快递</td>
                            </tr>
                            <?php  }?>
                            <?php if ($order_list[0]['payment_code'] == 'offline') {?>	
                            <tr>
                                <td></td>
                                <td class="text_center new_h40" colspan="5"><span class="f15 fb new_pr10">凭证号:</span><span class="new_c_main new_f16 fb"><?php echo $pay_info['order_cr'] ?></span></td>
                                <td></td>
                                <td></td>
                            </tr>	
                            <?php }?>
                        </tbody>
                    </table>
                    <div class="ml50">
                        <?php if($order_list[0]['payment_code'] == 'offline' && $from_step != 'step1'){ ?>
                        <div class="mt20"><span>线下支付</span></div>
                        <div><p>1. 用户线下完成支付后，可上传付款凭证以加快财务确认到账。</p></div>
                        <div><span>上传付款凭证:</span><input type="file" name="order_crimg" id="order_crimg"/></div>
                        <?php } ?>
                        <?php if($order_list[0]['payment_code'] == 'offline'){ ?>	
                        <div class="mt20">
                            <strong>收款账号:</strong>
                            <p>开户银行：招商银行股份有限公司广州林和路支行</p>
                            <st>开户帐号：<strong>1209 0891 2110 802</strong></p>
                                <p>公司名称：广州合摩计算机科技有限公司</p>
                        </div>
                        <div class="mt20"><p>注意事项：个人账户汇款请在汇款用途处填写公司名称</p></div>
                        <?php } ?>
                        <?php if($order_list[0]['payment_code'] == 'offline' && $from_step != 'step1'){ ?>
                        <div class="ncc-bottom tc"><a href="javascript:void(0);" id="sumbit_cr" class="new_btn new_blue_btn"><i class="icon-shield new_mr5"></i>确认提交凭证</a></div>
                        <?php } ?>
                    </div>
                </div>
                <div class="ncc-receipt-info">
                    <?php if (!isset($payment_list)) {?>
                    <?php }else if (empty($payment_list)){?>
                    <div class="nopay">抱歉，暂时没有符合条件的支付方式，请 <a href="<?php echo url('member/message/send',array('member_id'=>$order['seller_id']));?>">联系卖家</a> 联系客服</div>
                    <?php } else {?>
                    <div class="ncc-receipt-info-title">
                        <h3>支付选择</h3>
                    </div>
                    <ul class="ncc-payment-list">
                        <?php foreach($payment_list as $val) { ?>
                        <li payment_code="<?php echo $val['payment_code']; ?>">
                            <label for="pay_<?php echo $val['payment_code']; ?>">
                                <i></i>
                                <div class="logo" for="pay_<?php echo $val['payment_id']; ?>"> <img alt="<?php echo $val['payment_name']; ?>" src="/old/shop/templates/new20160622/images/payment/<?php echo $val['payment_code']; ?>_logo.gif" /> </div>
                            </label>
                        </li>
                        <?php } ?>
                    </ul>
                    <?php } ?>
                </div>
                <?php if ($pay_amount_online > 0) {?>
                <div class="ncc-bottom tc mb50"><a href="javascript:void(0);" id="next_button" class="new_btn new_blue_btn"><i class="icon-shield new_mr5"></i>确认提交支付</a></div>
                <?php }?>
            </form>
    </div>
    <script type="text/javascript">
        $(function () {
            $('.ncc-payment-list > li').on('click', function () {
                $('.ncc-payment-list > li').removeClass('using');
                $(this).addClass('using');
                $('#payment_code').val($(this).attr('payment_code'));
            });
            $('#next_button').on('click', function () {
                if ($('#payment_code').val() == '') {
                    showDialog('请选择支付方式', 'error', '', '', '', '', '', '', '', '', 2);
                    return false;
                }
                $('#buy_form').submit();
            });
            $('#sumbit_cr').on('click', function () {
                if (!$('#order_crimg').val()) {
                    showDialog('请选择提交凭证图片', 'error', '', '', '', '', '', '', '', '', 2);
                    return false;
                } else {
                    $('#buy_form').submit();
                }
            })
        });
    </script>
</div>

{/block}